package com.chrray.position.enums.app;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 0-待审核／-1 驳回／1-进行中／2-已完成／3-已结束/4-已下架/5-匹配中
 */
public enum FdJobStateEnum implements BaseEnum{
    PENDING(0, "待审核"),
    REJECTED(-1, "驳回"),

    // 匹配中,小程序原型图没有这个状态
    MATCHING(5,"匹配中"),

    IN_PROGRESS(1, "进行中"),

    COMPLETED(2, "已完成"),

    // 已结束,小程序原型图没有这个状态
    FINISHED(3, "已结束"),
    // 已下架,小程序原型图没有这个状态
    OFF_SHELF(4, "已下架"),

    WAIT(6,"待发布"),
    ;

    @JsonValue
    @EnumValue
    private final Integer value;
    private final String info;

    FdJobStateEnum(Integer value, String info) {
        this.info = info;
        this.value = value;
    }

    @JsonCreator
    public static FdJobStateEnum getByValue(Integer value) {
        for (FdJobStateEnum en : FdJobStateEnum.values()) {
            if (en.getValue().equals(value)) {
                return en;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }
}
